package com.cloudcc.mobile.view.base;

import com.cloudcc.mobile.weight.LoadingDialog;

public abstract class BaseFragment extends CFragment {

	protected LoadingDialog mWaiting;

	@Override
	public void init() {
	}

	/**
	 * 显示 等待 的 dialog
	 * 
	 * @param message
	 *            提示语
	 * @return 返回 LoadingDialog
	 */
	protected LoadingDialog showWainting(String message) {
		mWaiting = new LoadingDialog(mContext, message);
		mWaiting.setCancelable(true);
		mWaiting.show();
		return mWaiting;
	}
	/**显示一个正在加载的默认
	 * @return
	 */
	protected LoadingDialog showWainting() {
		return showWainting("正在加载...");
	}
	
	

	/**
	 * 显示 等待 的 dialog
	 * 
	 * @return 返回 LoadingDialog
	 */
	protected LoadingDialog createWainting() {
		mWaiting = new LoadingDialog(mContext);
		return mWaiting;
	}

	/**
	 * 取消 显示等待的dialog
	 */
	protected void dismissWainting() {
		if (mWaiting != null) {
			mWaiting.dismiss();
			mWaiting = null;
		}
	}
}
